package com.stx.day0911;

/**
 * packageName com.stx.day0911
 *
 * @author YangYi
 * @className StringDemo01
 * @date 2025/9/11
 * @description TODO
 */
public class StringDemo01 {
    public static void main(String[] args) {
//        int i = 12;
//        short s = 12;
//        System.out.println(i == s);
//        String str = "hello";
//        String str1 = new String("hello");
//        String str3 = new String("hello");
//        String str2 = "hello";
//        // ==
//        System.out.println(str == str1);//true
//        System.out.println(str == str2);//true
//        System.out.println(str1 == str3);
//        // equals
//        System.out.println(str.equals(str1));//true
//        System.out.println(str.equals(str2));//false
//        System.out.println(str1.equals(str3));

        StringBuilder sbd = new StringBuilder("hello");
        System.out.println(sbd);
        sbd.append(" world");
        System.out.println(sbd);
        String str4 = "hello";
        str4.concat(" world");
        System.out.println(str4);
        StringBuffer sbf = new StringBuffer("hello");
        sbf.append(" world");
        System.out.println(sbf);
        System.out.println(sbf.reverse());

    }
}
